package com.mining.app.zxing.view;

import android.content.Context;

public class ProgressDialogUtils {

	private static ProgressDialogUtils pd;
	
	private CustomProgressDialog progressDialog;
	
	public static ProgressDialogUtils getInstance(){
		if(pd==null){
			pd=new ProgressDialogUtils();
		}
		return pd;
	}
	
	
	public void startProgressDialog(Context context,String text){
		progressDialog = CustomProgressDialog.createDialog(context,text);
		try{
	    	progressDialog.show();
		}catch(Exception e){
			progressDialog =null;
		}
		
	}
	
	public void stopProgressDialog(Context context){
		if(progressDialog==null){
			progressDialog = CustomProgressDialog.createDialog(context,null);
		}
		try{
			progressDialog.dismiss();
			progressDialog = null;
		}catch(Exception e){
			progressDialog =null;
		}

	}
}
